package start.aai.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jakarta.annotation.Resource;
import start.aai.entity.Conversations;
import start.aai.service.ConversationsService;
import start.aai.mapper.ConversationsMapper;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author 27465
* @description 针对表【conversations】的数据库操作Service实现
* @createDate 2025-07-09 14:51:18
*/
@Service
public class ConversationsServiceImpl extends ServiceImpl<ConversationsMapper, Conversations>
    implements ConversationsService{
    @Resource
    private ConversationsMapper conversationsMapper;

    public Integer newConversation(Conversations conversations) {
        conversationsMapper.insert(conversations);
        return 1;
    }

    public List<Conversations> getHistory(Integer userId) {
        return conversationsMapper.getHistory(userId);
    }
}




